cmake_minimum_required(VERSION 2.8)

#-------------------------------------------------------------------------------------------------
#------------------ include directories of ATOMISM and set source files-----------------------------
#-------------------------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake_FindModules )


message(STATUS "\n----------From src/Molecule/CMakeLists.txt----------")
message(STATUS "Base include directories: ${ATOMISM_BASE_INCLUDE_DIRS}")
message(STATUS "Base libraries: ${ATOMISM_BASE_LIBRARIES}")

FILE(GLOB MATH_SRC  ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp )
FILE(GLOB MATH_HEADER  ${CMAKE_CURRENT_SOURCE_DIR}/*.h )

INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/  ${ATOMISM_BASE_INCLUDE_DIRS}/ )

#-------------------------------------------------------------------------------------------------
#------------------ compile library base --------------------------------------------------------
#-------------------------------------------------------------------------------------------------

#add_library ( math   SHARED ${MATH_SRC}  ) 

add_library ( math   SHARED ${MATH_SRC}  ) 

IF( NOT COVERAGE )
   SET_TARGET_PROPERTIES( math PROPERTIES COMPILE_FLAGS -fPIC )
   SET_TARGET_PROPERTIES( math PROPERTIES COMPILE_FLAGS -O3 )
ENDIF(NOT COVERAGE )

TARGET_LINK_LIBRARIES( math ${ATOMISM_BASE_LIBRARIES} )
set_target_properties(math PROPERTIES  SUFFIX .so)

SET( ATOMISM_MATH_INCLUDE_DIRS  ${CMAKE_CURRENT_SOURCE_DIR}  )
SET( ATOMISM_MATH_LIBRARIES     math  )

INSTALL(FILES  ${MATH_HEADER} DESTINATION ${CMAKE_INSTALL_PREFIX}/include )






